The
CreateMarketFilter method on the MarketData object allows you to retrieve a number of Market objects without having to navigate through the Exchange / Contract / ContractMonth tree. Specify the ExchangeID, ContractID to return all the markets for the specified contract:
' Reference to the market list filter that we request.
Private WithEvents moFilter As MarketList
…
' Request all the 'N' contracts on the Dummy exchange on the simulator.
moFilter = moAPI.MarketData.CreateMarketFilter("D_D", "N")
' Check to see if the data is already loaded.
If moFilter.Complete Then
' Call the event handler ourselves as the data is already loaded.
moFilter_MarketListComplete(moFilter)
End If
…
' Event raised when the collection data has been loaded.
Private Sub moFilter_MarketListComplete(ByVal poMarketList As T4.API.MarketList) Handles moFilter.MarketListComplete
' Display the name of each market loaded.
For Each oMarket As Market In poMarketList
Trace.WriteLine(oMarket.Description)
Next
End Sub